package com.cmc.cloud.cmclink.doc.api.document;

import com.cmc.cloud.cmclink.doc.api.document.rep.DgCommodityRespDto;
import com.cmc.cloud.cmclink.doc.api.document.req.DgCommodityReqDto;
import com.cmc.cloud.cmclink.doc.constant.DocApiConstants;
import com.cmes.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * 服务 危险品品名查询
 *
 * @author lzp
 */

@FeignClient(name = DocApiConstants.NAME)
@Tag(name = "RPC - 服务 危险品品名查询")
public interface DgCommodityApi {

    String FREFIX = DocApiConstants.PREFIX + "/dgCommodity";

    /**
     * 危险品品名查询
     *
     * @param dgCommodityReqDto
     * @return
     */
    @Operation(summary = "危险品品名查询(主)")
    @PostMapping(FREFIX + "/query")
    CommonResult<List<DgCommodityRespDto>> queryDgCommodity(@Valid @RequestBody DgCommodityReqDto dgCommodityReqDto);

    /**
     * 危险品品名查询(详情)
     *
     * @param id
     * @return
     */
    @Operation(summary = "详情查询")
    @GetMapping(FREFIX + "/psn/{id}")
    CommonResult<List<String>> queryDgCommodityPsn(@PathVariable("id") Long id);

}
